#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>
int main ()
{
	int i = 0;
	int tmp = 0;
	int sum = 0;
	int count = 1;
	for(i=1;i<100000;i++)
	{
		sum = 0;
		count = 1;
		tmp = i;
		while(tmp/10)
		{
		    count++;
			tmp = tmp/10;
		}
		tmp = i;
		sum = 0;
		while(tmp)
		{
		    sum += pow(tmp%10,count);
			tmp = tmp/10;
		}
		if(sum>10)
		{
		  if(sum==i)
			 printf("%d ",i);
		}
	}
    return 0;
}